import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class Menu here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Menu extends World
{

    /**
     * Constructor for objects of class Menu.
     * 
     */
    private Tutorial tutorial;
    private Play play;
    private Records records;
    private int iniciaTutorial;
    private int contador;
    private fondo Fondo;
    private fondo fondoTutorial;
    public Siguiente siguiente;
    
    public Menu()
    {    
        // Create a new world with 600x400 cells with a cell size of 1x1 pixels.
        super(600, 400, 1,false); 
        creaMenu();
        iniciaTutorial=0;
        contador=0;
        
    }

    public void act(){
        
        if(iniciaTutorial==1){
            if(contador!=115){contador++;}
            if(contador==110){
                fondoTutorial=new fondo(0,0,0,2);
                addObject(fondoTutorial,(getWidth()/2),(getHeight()/2));
                siguiente = new Siguiente();
                addObject(siguiente,575,205);
            }
        }

    }

    public void creaMenu(){
        Fondo=new fondo(0,0,0,0);
        addObject(Fondo,(getWidth()/2),(getHeight()/2));
        play=new Play();
        addObject(play,100,85-110);
        tutorial=new Tutorial();
        addObject(tutorial,296,30-110);
        records =new Records();
        addObject(records,487,-25-110);

    }

    public void desapareceTutorial(){
        play.desaparece();
        records.desaparece();
       
    }

    public void desapareceRecords(){
        play.desaparece();
        tutorial.desaparece();
    }

    public void desaparecePlay(){
        tutorial.desaparece();
        records.desaparece();
    }
    public void sigTutorial()
    {
    fondoTutorial.sigTutorial();
    }
    public void iniciaTutorial(){iniciaTutorial=1;}
    
    public void quitaTutorial(){
    removeObject(fondoTutorial);
    removeObject(siguiente);
    removeObject(Fondo);
     creaMenu();
    }
}